import java.util.Scanner;

/**
 * @Title: 筛质数
 * @Author 贾金博
 * @Package PACKAGE_NAME
 * @Date 2024/3/15 11:19
 * @description: 经典的模板题
 */
public class 筛质数 {
    public static Scanner sc = new Scanner(System.in);
    public static int[] primes = new int[1000050];
    public static boolean[] f = new boolean[1000050];
    public static int cnt = 0;

    public static void main(String[] args) {
        int n = sc.nextInt();
        isPrime();

        int l = 0, r = cnt + 1;

        while(l + 1 < r) {
            int mid = (l + r) >> 1;
            if(primes[mid] <= n)l = mid;
            else r = mid;
        }
        System.out.println(l);
    }

    public static void isPrime() {
       // f[1] = true; // 表示这个数不是质数
        int n = 1000010;
        for(int i = 2; i <= n; ++ i ) {
            if(!f[i])primes[++ cnt ] = i;
            for(int j = 1; primes[j] <= n / i; ++ j ) {
                f[i * primes[j]] = true;
                if(i % primes[j] == 0)break;
            }
        }
    }
}
